﻿HmJS.$Import('util.DateRange');
//HmJS.$Import('core.domready');

HmJS.register('demo.module.util.daterange', function ($ns) {
	var that = {};

	that.todo = function () {
		var range = new $ns.util.DateRange(new Date(), new Date(+(new Date) + 10000));
		function setResult(date) {
			$('result').adopt(new Element('li').set('html', (date + ' :: <strong>' + (range.isValid(date) ? 'in' : 'out') + '</strong>')));
		}

		setResult(new Date());
		setTimeout(function () { setResult(new Date()); }, 5000);
		setTimeout(function () { setResult(new Date()); }, 15000);
	};

	return that;
});
